package com.tuo51.childcare.repository.photoAlbum;

import com.tuo51.childcare.domain.photoalbum.PhotoAlbumTemplate;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


public interface PhotoAlbumTemplateRepository extends JpaRepository<PhotoAlbumTemplate, String>, JpaSpecificationExecutor<PhotoAlbumTemplate> {

       @Query(value = "select * from tb_photo_album_template t" +
               " where (t.aid=?1 or t.aid is null) and (t.deleted=false or t.deleted is null) " +
               "order by visitor,created", nativeQuery = true)
       List<PhotoAlbumTemplate> findAllByAreaId(String areaId);

}
